{"ast":null,"code":"import _objectSpread from \"@babel/runtime/helpers/esm/objectSpread2\";\nimport { useMemo } from 'react';\nvar DEFAULT_SIZE = {\n  width: 0,\n  height: 0,\n  left: 0,\n  top: 0\n};\nexport default function useOffsets(tabs, tabSizes, holderScrollWidth) {\n  return useMemo(function () {\n    var _tabs$;\n    var map = new Map();\n    var lastOffset = tabSizes.get((_tabs$ = tabs[0]) === null || _tabs$ === void 0 ? void 0 : _tabs$.key) || DEFAULT_SIZE;\n    var rightOffset = lastOffset.left + lastOffset.width;\n    for (var i = 0; i < tabs.length; i += 1) {\n      var key = tabs[i].key;\n      var data = tabSizes.get(key); // Reuse last one when not exist yet\n\n      if (!data) {\n        var _tabs;\n        data = tabSizes.get((_tabs = tabs[i - 1]) === null || _tabs === void 0 ? void 0 : _tabs.key) || DEFAULT_SIZE;\n      }\n      var entity = map.get(key) || _objectSpread({}, data); // Right\n\n      entity.right = rightOffset - entity.left - entity.width; // Update entity\n\n      map.set(key, entity);\n    }\n    return map;\n  }, [tabs.map(function (tab) {\n    return tab.key;\n  }).join('_'), tabSizes, holderScrollWidth]);\n}","map":{"version":3,"names":["_objectSpread","useMemo","DEFAULT_SIZE","width","height","left","top","useOffsets","tabs","tabSizes","holderScrollWidth","_tabs$","map","Map","lastOffset","get","key","rightOffset","i","length","data","_tabs","entity","right","set","tab","join"],"sources":["/data/messenger.client/node_modules/rc-tabs/es/hooks/useOffsets.js"],"sourcesContent":["import _objectSpread from \"@babel/runtime/helpers/esm/objectSpread2\";\nimport { useMemo } from 'react';\nvar DEFAULT_SIZE = {\n  width: 0,\n  height: 0,\n  left: 0,\n  top: 0\n};\nexport default function useOffsets(tabs, tabSizes, holderScrollWidth) {\n  return useMemo(function () {\n    var _tabs$;\n\n    var map = new Map();\n    var lastOffset = tabSizes.get((_tabs$ = tabs[0]) === null || _tabs$ === void 0 ? void 0 : _tabs$.key) || DEFAULT_SIZE;\n    var rightOffset = lastOffset.left + lastOffset.width;\n\n    for (var i = 0; i < tabs.length; i += 1) {\n      var key = tabs[i].key;\n      var data = tabSizes.get(key); // Reuse last one when not exist yet\n\n      if (!data) {\n        var _tabs;\n\n        data = tabSizes.get((_tabs = tabs[i - 1]) === null || _tabs === void 0 ? void 0 : _tabs.key) || DEFAULT_SIZE;\n      }\n\n      var entity = map.get(key) || _objectSpread({}, data); // Right\n\n\n      entity.right = rightOffset - entity.left - entity.width; // Update entity\n\n      map.set(key, entity);\n    }\n\n    return map;\n  }, [tabs.map(function (tab) {\n    return tab.key;\n  }).join('_'), tabSizes, holderScrollWidth]);\n}"],"mappings":"AAAA,OAAOA,aAAa,MAAM,0CAA0C;AACpE,SAASC,OAAO,QAAQ,OAAO;AAC/B,IAAIC,YAAY,GAAG;EACjBC,KAAK,EAAE,CAAC;EACRC,MAAM,EAAE,CAAC;EACTC,IAAI,EAAE,CAAC;EACPC,GAAG,EAAE;AACP,CAAC;AACD,eAAe,SAASC,UAAU,CAACC,IAAI,EAAEC,QAAQ,EAAEC,iBAAiB,EAAE;EACpE,OAAOT,OAAO,CAAC,YAAY;IACzB,IAAIU,MAAM;IAEV,IAAIC,GAAG,GAAG,IAAIC,GAAG,EAAE;IACnB,IAAIC,UAAU,GAAGL,QAAQ,CAACM,GAAG,CAAC,CAACJ,MAAM,GAAGH,IAAI,CAAC,CAAC,CAAC,MAAM,IAAI,IAAIG,MAAM,KAAK,KAAK,CAAC,GAAG,KAAK,CAAC,GAAGA,MAAM,CAACK,GAAG,CAAC,IAAId,YAAY;IACrH,IAAIe,WAAW,GAAGH,UAAU,CAACT,IAAI,GAAGS,UAAU,CAACX,KAAK;IAEpD,KAAK,IAAIe,CAAC,GAAG,CAAC,EAAEA,CAAC,GAAGV,IAAI,CAACW,MAAM,EAAED,CAAC,IAAI,CAAC,EAAE;MACvC,IAAIF,GAAG,GAAGR,IAAI,CAACU,CAAC,CAAC,CAACF,GAAG;MACrB,IAAII,IAAI,GAAGX,QAAQ,CAACM,GAAG,CAACC,GAAG,CAAC,CAAC,CA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